﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UcEditWard.ascx.cs" Inherits="CompanyManagement.usercontrol.UcEditWard" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

<table class="table">
    <tr>
        <td colspan="2">
            <h4 id="H1" class="lighter" runat="server" visible='<%# (DataItem is Telerik.Web.UI.GridInsertionObject) %>'>
                <i class="icon-add"></i>
                Thêm mới Phường/Xã
            </h4>
            <h4 id="H2" class="lighter" runat="server" visible='<%# !(DataItem is Telerik.Web.UI.GridInsertionObject) %>'>
                <i class="icon-pencil"></i>
                Sửa thông tin Phường/Xã: <%# DataBinder.Eval( Container, "DataItem.ID") == null ? -1: DataBinder.Eval( Container, "DataItem.ID") %>
            </h4>
        </td>
    </tr>
    <tr>
        <td>
            <dl class="dl-horizontal">
                <dt style="padding-bottom:10px">Thuộc Quận/Huyện</dt>
                <dd style="padding-bottom:10px">
                    <asp:DropDownList ID="ddlDistrict" runat="server"></asp:DropDownList>
                </dd>
                <dt>Mã</dt>
                <dd>
                    <asp:TextBox ID="txtCode" runat="server" Text='<%# ProcessMyDataItem(DataBinder.Eval( Container, "DataItem.Code")) %>' MaxLength="10" 
                        Enabled='<%# (DataItem is Telerik.Web.UI.GridInsertionObject) ? true : false %>'></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" CssClass="help-block" ErrorMessage="Vui lòng nhập mã Phường/Xã." ControlToValidate="txtCode" Display="Dynamic" ForeColor="Red"></asp:RequiredFieldValidator>
                </dd>
                <dt>Tên</dt>
                <dd>
                    <asp:TextBox ID="txtName" Rows="2" TextMode="MultiLine" runat="server" Text='<%# ProcessMyDataItem(DataBinder.Eval( Container, "DataItem.Name")) %>'></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" CssClass="help-block" ErrorMessage="Vui lòng nhập tên Phường/Xã." ControlToValidate="txtName" Display="Dynamic" ForeColor="Red"></asp:RequiredFieldValidator>
                </dd>
            </dl>
        </td>
    </tr>
    <tr>
        <td colspan="2">
            <dl class="dl-horizontal">
                <dt></dt>
                <dd>
                    <asp:Button ID="btnUpdate" Text="Lưu thay đổi" runat="server" CommandName="Update" Visible='<%# !(DataItem is Telerik.Web.UI.GridInsertionObject) %>'></asp:Button>
                    <asp:Button ID="btnInsert" Text="Thêm mới" runat="server" CommandName="PerformInsert"
                        Visible='<%# DataItem is Telerik.Web.UI.GridInsertionObject %>'></asp:Button>
                    &nbsp;
            <asp:Button ID="btnCancel" Text="Hủy" runat="server" CausesValidation="False"
                CommandName="Cancel"></asp:Button>
                </dd>
            </dl>
        </td>
    </tr>
</table>